package com.cy.pj.category.controller;

import com.cy.pj.category.pojo.Category;
import com.cy.pj.category.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Cx
 * @stage secondStageOfWeb
 * @creat 2020-11-11 17:10
 */
@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("/category/doFindCategory")
    public List<Category> doFindCategory() {
        return categoryService.findCategory();
    }

    @RequestMapping("/category/doInsertCategory")
    public void doInsertCategory(Category category){
        categoryService.insertCategory(category);
    }

}
